<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/8/1
 * Time: 12:01
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\admin\controller;

use app\common\business\Specs as BusObj;
use app\common\lib\Show;
use app\common\lib\Status;
use think\App;
use think\facade\View;

class Specs extends AdminBase
{
    protected ?BusObj $busObj = null;

    public function __construct(App $app)
    {
        $this->busObj = new BusObj();
        parent::__construct($app);
    }

    public function index()
    {
        return View::fetch();
    }

    public function dialog()
    {
        return View::fetch();
    }

    /**
     * @return \think\response\Json
     */
    public function getSpecsName()
    {
        try {
            $data = $this->busObj->getSpecsName();
        } catch (\Exception $e) {
            return Show::json_show(Status::Error, $e->getMessage());
        }
        return Show::json_show(Status::Success, "ok", $data);
    }
}
